package cn.com.qingz.modules.user.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;

import cn.com.qingz.modules.security.model.UserSession;
import cn.com.qingz.modules.user.model.City;
import cn.com.qingz.modules.user.model.Organization;
import cn.com.qingz.modules.user.model.SchoolVO;

public interface OrganizationMapper {

    /**
     * 通过名称查询Id 比如 秦皇岛-实验二小-三年级-一班 结果:1-2-3-4
     * @param name
     * @return
     *         SELECT CONCAT(org.pid,"-",id) as ids from organization org where org.parent_path_name = '秦皇岛-实验二小-三年级' AND org.orgName = '一班';
     */
    public String findIdsByName(@Param("full_path_name") String full_path_name);

    /**
     * 分页查询 ImeiORG
     * @param condition
     * @param pageBounds
     * @return
     */

    public PageList<SchoolVO> querySchool(PageBounds pageBounds);

    public Organization getOrgById(@Param("id") Long id);

    /**
     * 查询下一级的 子节点
     * @param pid
     * @return
     */
    public List<Organization> getChildrenByPid(@Param("pid") Long pid);

    public UserSession getSessionBeanByLoginCode(@Param("logincode") String logincode);

    public int count_imeiORG(@Param("imei") Long imei);

    public List<City> listCity();

    public void addOrg(Organization org);

    public int checkSchool(@Param("schoolName") String schoolName);

}
